﻿var storedTimeZoneOffset = readCookie('TimeZoneOffset'),
        currentTimeZoneOffset = (-(new Date()).getTimezoneOffset()).toString();
if (storedTimeZoneOffset === null || storedTimeZoneOffset !== currentTimeZoneOffset) {
    document.cookie = 'TimeZoneOffset' + "=" + currentTimeZoneOffset;
    document.location.reload(true);
}

function readCookie(name) {
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        var index = c.indexOf(name);
        if (index >= 0) 
            return c.substring(name.length + index + 1, c.length);
    }
    return null;
}